import { pubRequire } from '@utils/public'
const baseUrl = '/works'
//作品维护列表
export function getPreserveList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callbBack, errBack)
}
//批量删除
export function delItem(obj, callbBack, errBack) {
  return pubRequire('delete', `${baseUrl}`, obj, callbBack, errBack)
}
//我的发布列表
export function getMineList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/me`, obj, callbBack, errBack)
}
//我的发布-发布作品
export function pubWork(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callbBack, errBack)
}
//获取最新编辑者
export function editor(id, callbBack, errBack) {
  return pubRequire(
    'get',
    `${baseUrl}/${id}/latest-editor`,
    '',
    callbBack,
    errBack
  )
}
//修改虚拟分享量
export function changeShare(id, obj, callbBack, errBack) {
  return pubRequire(
    'put',
    `${baseUrl}/${id}/share-counts`,
    obj,
    callbBack,
    errBack
  )
}
//修改虚拟分享量
export function changePlay(id, obj, callbBack, errBack) {
  return pubRequire(
    'put',
    `${baseUrl}/${id}/play-counts`,
    obj,
    callbBack,
    errBack
  )
}
//单个删除
export function delSingle(id, obj, callbBack, errBack) {
  return pubRequire('delete', `${baseUrl}/${id}`, obj, callbBack, errBack)
}
//置顶
export function top(id, obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}/top`, obj, callbBack, errBack)
}
//取消置顶
export function unTop(id, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}/untop`, '', callbBack, errBack)
}
